<?php $this->load->view('admin/head.php'); ?>
<!--/sidebar-->
<div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="<?php echo site_url()?>/admin/index/index">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">推荐游戏管理</span></div>
    </div>
    <div class="search-wrap">
        <div class="search-content">
            <table class="search-tab">
                <tr>
                    <th width="70">名称搜索:</th>
                    <td><input class="common-text" placeholder="关键字" name="title" value="" id="title" type="text"></td>
                    <td><input class="btn btn-primary btn2" onclick="search();" name="sub" value="查询" type="button"></td>
                </tr>
            </table>
        </div>
    </div>
    <div class="result-wrap">
        <form name="myform" id="myform" method="post">
            <div class="result-title">
                <div class="result-list">
                    <a href="<?php echo site_url('admin/recommend/add/')?>"><i class="icon-font"></i>新增</a>
                    <!--<a id="batchDel" href="javascript:checkDel();"><i class="icon-font"></i>批量删除</a>-->
                    <!--<a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>更新排序</a>-->
                </div>
            </div>
            <div class="result-content">
                <table class="result-tab" width="100%">
                    <tr>
                        <th>ID</th>
                        <th>排序</th>
                        <th>名称</th>
                        <th>点击量</th>
                        <th>状态</th>
                        <th>游戏操作系统</th>
                        <th>添加时间</th>
                        <th>编辑</th>
                    </tr>
                    <?php foreach ($data as $key=>$val){?>
                        <tr>
                            <td><?php echo $val['id']?></td>
                            <td><?php echo $val['sort']?></td>
                            <td><?php echo $val['title']?></td>
                            <td><?php echo $val['click']; ?></td>
                            <td><?php
                                if($val['status']==0){
                                    echo '正常';
                                }elseif($val['status']==1){
                                    echo '<spen style="background: red">下架</spen>';
                                }
                                ?></td>
                            <td><?php
                                    if($val['type']==1){
                                        echo 'android';
                                    }elseif($val['type']==2){
                                        echo 'ios';
                                    }elseif($val['type']==3){
                                        echo 'windows';
                                    }
                                ?></td>
                            <td><?php echo date('Y-m-d H:i:s',$val['createtime']);?></td>
                            <td>
                                <a class="link-update" href="<?php echo site_url('admin/recommend/update/'.$val['id'])?>" class="btn btn-warning">查看</a>
                                <a class="link-del" href="javascript:if(confirm('确实要删除该内容吗'))location='<?php echo site_url('admin/recommend/delete/'.$val['id'])?>'" class="btn btn-danger col-xs-offset-1">删除</a>
                            </td>
                        </tr>
                    <?php } ?>
                </table>
                <div class="list-page"><?php echo $page_view; ?></div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    function search(){
        window.location.href="<?php echo site_url()?>/admin/recommend/index/?title=" + $('#title').val();
    }
</script>
<!--/main-->
</div>
</body>
</html>